<?php
namespace EM\NewsBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
class CategoryType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('name' ,'text',
					array('attr' => array('class' => 'validate[required,maxSize[30]]') ))
                ->add('description','textarea',array('required' => false))
                ->add('categoryParent', 'entity',array('label' => 'Parent: ',
						'empty_value' => 'Choose a parent',
						'class' => 'EMNewsBundle:Categories',
						'property' => 'name',
                                                'required' => false,
						));        
    }
    public function getName()
    {
        return 'category_form';
    }
}